﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Windows.Data;
using System.Globalization;

namespace BadHabit.Factory.Converters {

    

        [ValueConversion(typeof(string), typeof(string))]
        public class XsltTemplateItemConverter : IValueConverter {

            public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
                string templatePath = (string)value;
                return templatePath.Replace(".xslt", "");
            }

            public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
                string templateName = (string)value;
                return templateName + ".xslt";
            }

        }
    }
